cmake_minimum_required(VERSION 3.14)

project(motion_planning_qml VERSION 0.1 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick REQUIRED)
QT5_ADD_RESOURCES(RESOURCES_RCC qml.qrc)
# 添加第三方库
if(WIN32)
    set(THIRD_PARTY_DIR third_party/include)
    set(THIRD_PARTY_LIB third_party/windows/lib)
elseif(UNIX)
    set(THIRD_PARTY_DIR third_party/include)
    set(THIRD_PARTY_LIB third_party/ubuntu/lib)
elseif(APPLE)
endif()

include_directories(
    ${THIRD_PARTY_DIR}
    motion_planning
    )
link_directories(
    ${THIRD_PARTY_LIB}
    )

add_subdirectory(motion_planning)


set(SOURCE
    ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
    )
set(QML
    ${CMAKE_CURRENT_SOURCE_DIR}/main.qml
    )
if(WIN32)
    add_executable(motion_planning_qml WIN32
        ${SOURCE}
        ${RESOURCES_RCC}
        ${QML}
        )
else()
    add_executable(motion_planning_qml
        ${SOURCE}
        ${RESOURCES_RCC}
        ${QML}
        )
endif()

target_link_libraries(motion_planning_qml
    PRIVATE
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Quick
    )
